package src

import (
	"context"
	appsv1 "k8s.io/api/apps/v1"
	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/client-go/kubernetes"
)

func getNamespace(clientset *kubernetes.Clientset, name string) (*v1.Namespace, error) {
	return clientset.CoreV1().Namespaces().Get(context.TODO(), name, metav1.GetOptions{})
}

func getService(clientset *kubernetes.Clientset, namespace, serviceName string) (*v1.Service, error) {
	return clientset.CoreV1().Services(namespace).Get(context.TODO(), serviceName, metav1.GetOptions{})
}

func getDeployment(clientset *kubernetes.Clientset, namespace, deploymentName string) (*appsv1.Deployment, error) {
	return clientset.AppsV1().Deployments(namespace).Get(context.TODO(), deploymentName, metav1.GetOptions{})
}

func getPod(clientset *kubernetes.Clientset, namespace, podName string) (*v1.Pod, error) {
	return clientset.CoreV1().Pods(namespace).Get(context.TODO(), podName, metav1.GetOptions{})
}
